package com.example.sprinbootdemo.service.impl;

import com.example.sprinbootdemo.entity.RentManagement;
import com.example.sprinbootdemo.mapper.RentManagementMapper;
import com.example.sprinbootdemo.service.RentManagementService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class RentManagementServiceImpl implements RentManagementService {

    @Autowired
    private RentManagementMapper rentManagementMapper;

    @Override
    public List<RentManagement> getAllRentManagements() {
        return rentManagementMapper.selectAll();
    }

    @Override
    public void addRentManagement(RentManagement rentManagement) {
        rentManagementMapper.addRentManagement(rentManagement);
    }

    @Override
    public void deleteRentManagementByRentID(int rentID) {
        rentManagementMapper.deleteRentManagementByRentID(rentID);
    }

    @Override
    public void updateRentManagementByRentID(RentManagement rentManagement) {
        rentManagementMapper.updateRentManagementByRentID(rentManagement);
    }

    @Override
    public RentManagement getRentManagementByRentID(int rentID) {
        return rentManagementMapper.getRentManagementByRentID(rentID);
    }
}
